home *** CD-ROM | disk | FTP | other *** search
- Path: nntp.teleport.com!usenet
- From: GHouck <hksys@teleport.com>
- Newsgroups: comp.lang.c
- Subject: Re: Question on pointers
- Date: 11 Apr 1996 20:32:52 GMT
- Organization: systems hk
- Message-ID: <4kjq9k$34m@nadine.teleport.com>
- References: <1996Apr8.233330.139449@forest>
- NNTP-Posting-Host: ip-pdx09-42.teleport.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.22 (Windows; I; 32bit)
-
- ebromber@forest.drew.edu wrote:
- >In a program there is an array of structs. One of the headers for a
- >function says void pop(stack *). My question is shouldn't there be a name
- >or identifier after the asterisk? My friend says that it is the address of
- >a stack in the array. If this is true, how could I access the thing
- >pointed to?
- >Here are some lines which define a stack
- >
- >typedef struct item item;
- >struct item {
- > struct item *next;
- > char c;
- > }
- >typedef item *stack;
- >
- My assumption would be that your header file that contains the function
- prototype, is indicating that function 'pop' takes a pointer to a type
- called 'stack'. It doesn't have to give you the actual variable name,
- although it could provide a meaningful example; e.g., void pop ( stack *Pstack );
- The actual declaration of instance(s) of the type 'stack' are what you
- would use in any call to 'pop'.
- Yours, Geoff Houck
-
-
-
-